package com.louis.test.impl;

import com.louis.test.Calculator;

/**
 * @author XRY
 * @date 2023年06月26日20:49
 */
//带日志的实现类
public class CalculateLogImpl implements Calculator {
    @Override
    public int add(int i, int j) {
        System.out.println("[日志]add方法开始，参数是"+ i+" " + j);
        int result = i + j;
        System.out.println("方法内部：resultAdd = " + result);
        System.out.println("[日志]add方法结束，结果是：" + result);
        return result;
    }

    @Override
    public int minus(int i, int j) {
        System.out.println("[日志]minus 方法开始，参数是"+ i+" " + j);
        int result = i - j;
        System.out.println("方法内部：resultMinus = " + result);
        System.out.println("[日志]minus 方法结束，结果是：" + result);
        return result;

    }

    @Override
    public int multiply(int i, int j) {
        System.out.println("[日志]multiply 方法开始，参数是"+ i+" " + j);
        int result = i * j;
        System.out.println("方法内部：resultMultiply = " + result);
        System.out.println("[日志]multiply 方法结束，结果是：" + result);
        return result;
    }

    @Override
    public int div(int i, int j) {
        System.out.println("[日志]div 方法开始，参数是"+ i+" " + j);
        int result = i / j;
        System.out.println("方法内部：resultDiv = " + result);
        System.out.println("[日志]div 方法结束，结果是：" + result);
        return result;
    }
}
